home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: a pointer problem
- Date: 02 Feb 1996 18:41:20 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb2114120@qcd.lanl.gov>
- References: <4errk0$4c3@srvr1.engin.umich.edu> <31120AB7.1C44@cmt.lpr.mail.carel.fi>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Ari Lukumies's message of Fri, 02 Feb 1996 14:59:35 +0200
-
- In article <31120AB7.1C44@cmt.lpr.mail.carel.fi> Ari Lukumies
- <aril@cmt.lpr.mail.carel.fi> writes:
- <snip>
- You'll have to explicitly initialize the pointer, ANSI C (or any other standard)
- doesn't do it for you. However, most compilers tend to initialize variables (also
- pointers) declared outside of any function scope (or 'static' variables inside
- functions) to zero/NULL, but I wouldn't count on it.
-
- ANSI requires conforming compilers to initialize objects of static
- duration (i.e. 'static' variables inside and any variables outside
- functions) and uninitialized parts of partially initialized structs
- and arrays to be initialized as if an = 0 was explicitly typed
- in. (This is the form of the rule I find easiest to remember: if you
- prefer you can think of this as saying that all pointers are
- initialized to NULL and all floats to 0.0F etc.)
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-